﻿using JetBrains.Annotations;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Auditing;
using Volo.Abp.Validation;

namespace Loong.Admin.Users
{
    public class CreateUserDto
    {
        [Required]
        [DynamicStringLength(typeof(UserConsts), nameof(UserConsts.MaxUserNameLength))]
        public string UserName { get; set; }

        [DisableAuditing]
        [Required]
        [DynamicStringLength(typeof(UserConsts), nameof(UserConsts.MaxPasswordLength))]
        public string Password { get; set; }

        [DynamicStringLength(typeof(UserConsts), nameof(UserConsts.MaxNameLength))]
        public string Name { get; set; }

        [DynamicStringLength(typeof(UserConsts), nameof(UserConsts.MaxSurnameLength))]
        public string Surname { get; set; }

        [Required]
        [EmailAddress]
        [DynamicStringLength(typeof(UserConsts), nameof(UserConsts.MaxEmailLength))]
        public string Email { get; set; }

        [DynamicStringLength(typeof(UserConsts), nameof(UserConsts.MaxPhoneNumberLength))]
        public string PhoneNumber { get; set; }

        public bool IsActive { get; set; }

        public bool LockoutEnabled { get; set; }

        [CanBeNull]
        public string[] RoleNames { get; set; }
    }
}
